import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import axios from 'axios';

const app = createApp(App);

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(ElementPlus);
app.use(router);

// 创建axios实例
const instance = axios.create({
  baseURL: 'http://localhost:8090'
});

app.config.globalProperties.$axios = instance;
app.config.globalProperties.$httpUrl = 'http://localhost:8090';

app.mount('#app');